from time import sleep


class Queue(object):
    """实现一个队列"""

    def __init__(self):
        self.__list = []

    def enqueue(self, elem):
        """入队"""
        self.__list.append(elem)

    def dequeue(self):
        """出队"""
        return self.__list.pop(0)

    def is_empty(self):
        return not self.__list

    def size(self):
        """队列的大小"""
        return len(self.__list)


if __name__ == '__main__':
    my_queue = Queue()
    for i in range(10):
        vid = {'vid': i, 'vid_1': i + 1}
        my_queue.enqueue(vid)
    while not my_queue.is_empty():
        # count = 1
        vid_det = my_queue.dequeue()
        print(vid_det)
        if vid_det['vid'] == 13:
            continue
        else:
            my_queue.enqueue({'vid': vid_det['vid'] + 1, 'vid_1': vid_det['vid_1']})
        sleep(0.2)

        # print(my_queue.size())
